import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/tws/order/list',
    method: 'get',
    params: query
  })
}

// 查询待支付订单列表
export function paymentListOrder(query) {
  return request({
    url: '/tws/order/paymentList',
    method: 'get',
    params: query
  })
}

// 查询待开票订单列表
export function billListOrder(query) {
  return request({
    url: '/tws/order/billList',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/tws/order/' + id,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/tws/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/tws/order',
    method: 'put',
    data: data
  })
}

// 评价订单
export function starOrder(data) {
  return request({
    url: '/tws/order/starOrder',
    method: 'post',
    data: data
  })
}

// 删除订单
export function delOrder(id) {
  return request({
    url: '/tws/order/' + id,
    method: 'delete'
  })
}

// 查询近两笔订单
export function nearlyOrder() {
  return request({
    url: '/tws/order/nearlyOrder',
    method: 'get'
  })
}

//
export function comOrder(id,type) {
  return request({
    url:'/tws/order/comOrder',
    method:'post',
    params:{
      id:id,
      type:type
    }
  })
}
